﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbOsnapPointRef : OdDbPointRef
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbOsnapPointRef(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbOsnapPointRef_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbOsnapPointRef obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbOsnapPointRef()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbOsnapPointRef(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbOsnapPointRef cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbOsnapPointRef_cast(OdRxObject.getCPtr(pObj));
			OdDbOsnapPointRef result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbOsnapPointRef)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbOsnapPointRef)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbOsnapPointRef)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbOsnapPointRef_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbOsnapPointRef_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbOsnapPointRef_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbOsnapPointRef createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbOsnapPointRef_createObject();
			OdDbOsnapPointRef result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbOsnapPointRef)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbOsnapPointRef)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbOsnapPointRef)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OsnapMode osnapType()
		{
			OsnapMode result = (OsnapMode)TD_DbPINVOKE.OdDbOsnapPointRef_osnapType(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setOsnapType(OsnapMode osnapMode)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_setOsnapType(this.swigCPtr, (int)osnapMode);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbXrefFullSubentPath mainEntity()
		{
			OdDbXrefFullSubentPath result = new OdDbXrefFullSubentPath(TD_DbPINVOKE.OdDbOsnapPointRef_mainEntity(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbXrefFullSubentPath intersectEntity()
		{
			OdDbXrefFullSubentPath result = new OdDbXrefFullSubentPath(TD_DbPINVOKE.OdDbOsnapPointRef_intersectEntity(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getIdPath(OdDbFullSubentPath idPath)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_getIdPath(this.swigCPtr, OdDbFullSubentPath.getCPtr(idPath));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setIdPath(OdDbFullSubentPath idPath)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_setIdPath(this.swigCPtr, OdDbFullSubentPath.getCPtr(idPath));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getIntIdPath(OdDbFullSubentPath intIdPath)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_getIntIdPath(this.swigCPtr, OdDbFullSubentPath.getCPtr(intIdPath));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setIntIdPath(OdDbFullSubentPath intIdPath)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_setIntIdPath(this.swigCPtr, OdDbFullSubentPath.getCPtr(intIdPath));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double nearPointParam()
		{
			double result = TD_DbPINVOKE.OdDbOsnapPointRef_nearPointParam(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setNearPointParam(double nearOsnap)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_setNearPointParam(this.swigCPtr, nearOsnap);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint3d point()
		{
			OdGePoint3d result = new OdGePoint3d(TD_DbPINVOKE.OdDbOsnapPointRef_point(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPoint(OdGePoint3d pt)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_setPoint(this.swigCPtr, OdGePoint3d.getCPtr(pt));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbOsnapPointRef lastPointRef()
		{
			OdDbOsnapPointRef result = (OdDbOsnapPointRef)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbOsnapPointRef_lastPointRef__SWIG_0(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setLastPointRef(OdDbOsnapPointRef pOsnapPointRef)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_setLastPointRef(this.swigCPtr, OdDbOsnapPointRef.getCPtr(pOsnapPointRef));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual bool isGeomErased()
		{
			bool result = TD_DbPINVOKE.OdDbOsnapPointRef_isGeomErased(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual bool isXrefObj(OdDbObjectIdArray ids1, OdDbObjectIdArray ids2, bool isMainObj)
		{
			bool result = TD_DbPINVOKE.OdDbOsnapPointRef_isXrefObj__SWIG_0(this.swigCPtr, OdDbObjectIdArray.getCPtr(ids1), OdDbObjectIdArray.getCPtr(ids2), isMainObj);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual bool isXrefObj(OdDbObjectIdArray ids1, OdDbObjectIdArray ids2)
		{
			bool result = TD_DbPINVOKE.OdDbOsnapPointRef_isXrefObj__SWIG_1(this.swigCPtr, OdDbObjectIdArray.getCPtr(ids1), OdDbObjectIdArray.getCPtr(ids2));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult updateXrefSubentPath()
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbOsnapPointRef_updateXrefSubentPath(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult updateSubentPath(OdDbIdMapping idMap)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbOsnapPointRef_updateSubentPath(this.swigCPtr, OdDbIdMapping.getCPtr(idMap));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult evalPoint(OdGePoint3d pt)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbOsnapPointRef_evalPoint(this.swigCPtr, OdGePoint3d.getCPtr(pt));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult getEntities(OdDbFullSubentPathArray ents, bool getLastPtRef)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbOsnapPointRef_getEntities__SWIG_0(this.swigCPtr, OdDbFullSubentPathArray.getCPtr(ents), getLastPtRef);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult getEntities(OdDbFullSubentPathArray ents)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbOsnapPointRef_getEntities__SWIG_1(this.swigCPtr, OdDbFullSubentPathArray.getCPtr(ents));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void updateDueToMirror(bool inMirror)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_updateDueToMirror__SWIG_0(this.swigCPtr, inMirror);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void updateDueToMirror()
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_updateDueToMirror__SWIG_1(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getXrefHandles(OdHandleArray xrefHandles)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_getXrefHandles(this.swigCPtr, OdHandleArray.getCPtr(xrefHandles));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setXrefHandles(OdHandleArray xrefHandles)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_setXrefHandles(this.swigCPtr, OdHandleArray.getCPtr(xrefHandles));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getXrefIntHandles(OdHandleArray xrefHandles)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_getXrefIntHandles(this.swigCPtr, OdHandleArray.getCPtr(xrefHandles));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setXrefIntHandles(OdHandleArray xrefHandles)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_setXrefIntHandles(this.swigCPtr, OdHandleArray.getCPtr(xrefHandles));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void dwgInFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_dwgInFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void dwgOutFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_dwgOutFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDbOsnapPointRef_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler filer)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbOsnapPointRef_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(filer));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
